package exam;

import java.util.Arrays;
import java.util.Scanner;
import java.util.Stack;

public class Solution3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int k = in.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);
            Stack<Integer> stack1 = new Stack<>();
            Stack<Integer> stack2 = new Stack<>();
            for (int i = 0; i < arr.length; i++) {
                if(arr[i] % 2 == 0) {
                    stack1.push(arr[i]);
                }else {
                    stack2.push(arr[i]);
                }
            }
            int ret = stack1.pop();
            stack2.push(ret/2);
            k--;
            while(!stack1.isEmpty() && k != 0) {
                if(stack1.peek() >= stack2.peek()) {
                    stack2.push(stack1.pop()/2);
                    k--;
                }else if(stack1.peek() <= stack2.peek()) {
                    stack2.push(stack2.pop()/2);
                    k--;
                }
            }
            int sum = 0;
            if(!stack1.isEmpty() && k == 0) {
                while(!stack1.isEmpty()) {
                    sum += stack1.pop();
                }
            }
            while(!stack2.isEmpty()) {
                sum += stack2.pop();
            }
            System.out.println(sum);
        }
    }
}
